#ifndef TALK_H
#define TALK_H

#include <QtGui/QWidget>
#include <QtGui/QFileDialog>
#include <QtCore/QTextCodec>
#include <QListWidget>
#include <QFontComboBox>
#include <QComboBox>
#include <QToolButton>
#include <QLayout>
#include <QIcon>
#include <QLabel>
#include <QTextCharFormat>
#include <QColorDialog>
#include <QTextCursor>
#include "widget.h"

namespace Ui {
    class talk;
}

class talk : public QWidget {
    Q_OBJECT
    Q_DISABLE_COPY(talk)
public:
    explicit talk(QWidget *parent = 0);
    virtual ~talk();
    void paintEvent(QPaintEvent *event);
protected:
    virtual void changeEvent(QEvent *e);

private:
    Ui::talk *m_ui;
    Widget *myWidget;
    QListWidget *MyListView;
    QLabel *label1;
    QLabel *label2;
    QFontComboBox *fontBox;
    QComboBox *sizeBox;
    QToolButton *boldBtn;
    QToolButton *italicBtn;
    QToolButton *underBtn;
    QToolButton *colorBtn;
    bool fontbool;
    void mergeFormat(QTextCharFormat);


private slots:
    void on_pushButton_3_clicked();
    void on_pushButton_2_clicked();
    void on_pushButton_clicked();
    void slotFont(QString);
    void slotSize(QString);
    void slotBold();
    void slotItalic();
    void slotUnder();
    void slotColor();
    void slotCurrentFormatChanged(const QTextCharFormat &fmt);

};

#endif // TALK_H
